home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / Utilities / Interfaces / NmSpcUtl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  2.4 KB  |  69 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        NmSpcUtl.h
  3.  
  4.     Contains:    Utilities for working with NameSpaces.
  5.  
  6.     Owned by:    Caia Grisar
  7.  
  8.     Copyright:    © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     
  11.  
  12.     In Progress:
  13.         
  14. */
  15.  
  16.  
  17. #ifndef _NMSPCUTL_
  18. #define _NMSPCUTL_
  19.  
  20. #ifndef _ODTYPES_
  21. #include <ODTypes.h>
  22. #endif
  23.  
  24. #ifndef _STORUTIL_
  25. #include "StorUtil.h"
  26. #endif
  27.  
  28. class ODValueNameSpace;
  29. class ODValueIterator;
  30.  
  31. extern "C" {
  32.     void        ValueNameSpaceRegister(ODValueNameSpace* ns, Environment* ev, ODISOStr key, ODPtr buffer, ODULong size);
  33.  
  34.     ODBoolean    ValueNameSpaceGetEntry(ODValueNameSpace* ns, Environment* ev, ODISOStr key, ODPtr* value, ODULong* valueLength);
  35.                 // value must be a pointer to where you would like to have a 
  36.                 // pointer written. If the entry exists, a copy will be
  37.                 // allocated and returned in *value, which you must eventually
  38.                 // deallocate (because you now own this space); otherwise
  39.                 // *value will be nil when there is no such entry.
  40.     
  41.     ODBoolean    ValueNameSpaceGetODName(ODValueNameSpace* ns, Environment* ev, ODISOStr key, ODName** value);
  42.                 // value must be a pointer to an ODName to where you would like to have a 
  43.                 // pointer written. If the entry exists, an IText will be created
  44.                 // and returned in *value, which you must eventually
  45.                 // dispose of (because you now own this space); otherwise
  46.                 // *value will be nil when there is no such entry.
  47.     
  48.     void        ValueIteratorFirst(ODValueIterator* nsitr, Environment* ev, ODISOStr* key, ODPtr* value, ODULong* valueLength);
  49.                 // Unless the iteration is complete, *key and *value return
  50.                 // newly allocated copies of the next key and value.  You are
  51.                 // responsible for deallocated this space when you are done
  52.                 // with it.
  53.     
  54.     void        ValueIteratorNext(ODValueIterator* nsitr, Environment* ev, ODISOStr* key, ODPtr* value, ODULong* valueLength);
  55.                 // Unless the iteration is complete, *key and *value return
  56.                 // newly allocated copies of the next key and value.  You are
  57.                 // responsible for deallocated this space when you are done
  58.                 // with it.
  59.  
  60.     ODISOStr    ValueNameSpaceGetString( ODSession*, ODISOStr nameSpaceName, ODISOStr key );
  61.                 // ** Returns pointer to new copy of string, or NULL.
  62.                     
  63.     void ValueNameSpaceWriteToFile( ODValueNameSpace* ns, PlatformFile* file );
  64.     void ValueNameSpaceReadFromFile( ODValueNameSpace* ns, PlatformFile* file );
  65.     ODTradITextData* CreateFlatIText(ODScriptCode scriptCode, ODLangCode langCode, 
  66.                                                 char* theText, ODUShort textLen);
  67. }
  68.  
  69. #endif